import requests,re
headers = {
        'Referer': 'http://www.baidu.com/',
        'Origin':'http://www.baidu.com/',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36',
        'Cookie':'BAIDUID=EBEA8880C23200910DFF3E7E174D2046:FG=1; BIDUPSID=EBEA8880C23200910DFF3E7E174D2046; PSTM=1587205902; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; H_PS_PSSID=1443_31326_21115_31110_31591_31464_30823; delPer=0; PSINO=3; BDRCVFR[tox4WRQ4-Km]=mk3SLVN4HKm; BDRCVFR[-pGxjrCMryR]=mk3SLVN4HKm; BDRCVFR[CLK3Lyfkr9D]=mk3SLVN4HKm; userFrom=www.baidu.com; firstShowTip=1; cleanHistoryStatus=0; indexPageSugList=%5B%22%E7%BE%8E%E5%A5%B3%22%2C%22%E5%A6%B9%E5%AD%90%22%5D'

    }

url='https://image.baidu.com/search/index?tn=baiduimage&ipn=r&ct=201326592&cl=2&lm=-1&st=-1&fm=index&fr=&hs=0&xthttps=111110&sf=1&fmq=&pv=&ic=0&nc=1&z=&se=1&showtab=0&fb=0&width=&height=&face=0&istype=2&ie=utf-8&word=%E7%BE%8E%E5%A5%B3'
res=requests.get(url=url,headers=headers).text
result=re.findall('"hoverURL":"(.*?)"',res)
print(result)
print(type(result))
i=0
for url0 in result:

    pic_name=str(i)+'.jpg'
    with open(pic_name,'wb') as f:
        r=requests.get(url0,headers=headers)
        f.write(r.content)
    i+=1


